﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


class SortArray
{
    static void Main()
    {
        int[] array = new int[] {6, 5, 4, 3, 5, 1, 42, -1};

        int element = 0;
        int size = array.Length;

        for (int i = 1; i < size; i++)
        {
            for (int j = size - 1; j >= i; j--)
            {
                if (array[j - 1] > array[j])
                {
                    element = array[j - 1];
                    array[j - 1] = array[j];
                    array[j] = element;
                }
            }
        }

        for (int i = 0; i < size; i++)
        {
            Console.Write(" " + array[i]);
        }
        Console.WriteLine();
    }
}